package com.mqtt.nettymqtt.controller;


import com.mqtt.nettymqtt.client.MQTTClient;
import com.mqtt.nettymqtt.entity.Mqtt;
import com.mqtt.nettymqtt.utils.ContextUtil;
import com.mqtt.nettymqtt.utils.JdbcUtil;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author ln
 * @since 2020-12-04
 */
@Slf4j
@RestController
@RequestMapping("/mqtt")
public class MqttController {

    @RequestMapping("/test")
    public void test() {
        List<Mqtt> mqttList = JdbcUtil.select();
        for (Mqtt mqtt : mqttList) {
            log.info("mqtt: {}", mqtt);
        }
    }

}

